// components/form-item/index.js
Component({
  /**
   * 组件的属性列表
   */
  attached: function () { 
    // console.log('逐渐',this.data.range)

  },
  properties: {
    mode:{
      type:String,
      value: 'selector'
    },
    key:String,
    range:{
      type:[Array,Object],
      value:()=>([])
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    index:'',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    bindPickerChange(e){
      let index=e.detail.value;
      this.setData({
        index
      })
      this.triggerEvent('pickerChange',{value:this.data.range[index],index,key:this.data.key})
      
    },
  }
})
